It is known in the art that asynchronous transactional replication can be used to maintain one or more copies of a source object (for example, a relational table managed by a relational database management system, but can also be stored procedures calls or other objects managed by the database). The source table copies are updated through ACID transactions (Atomicity, Consistency, Isolation and Durability), modifying one or more source tables. Typically in a relational database, changes made by transactions are written to a file called the recovery log before they are applied on the actual tables. This ensures that the tables are updated even in the eventuality of a hardware or software failure.
A typical replication solution has a capture program (“Capture”) and an apply program (“Apply”) at each node. Capture reads changes of committed transactions from the recovery log at a source node and sends them to Apply running on a target node. The target node then re-executes the changes of the transactions. By re-executing transaction changes on the target node, this solution guarantees that the target table copies are always a valid image of the source table copy, even though the images may lag behind in time, because of the time required to propagate and apply the changes.
When a new table copy is to be added to an existing replication group where table changes are replicated/grouped in their original transaction, the new table copy must first be initialized and loaded with the current data in the replication group before participating in the asynchronous replication. One conventional approach to the initialization of the new table copy is to assume that the user performs the initial load. The replication software is then started once the load is over. This requires that changes to the table copy being loaded must be suspended at the source table and the other table copies. Another conventional approach allows the source table to be modified during the load, but suspends application of changes for the other active table copies in the replication group until the completion of the load process. Since a load process can take a long time, this interruption of the replication service is significant.
Accordingly, there exist a need for a method and system for an automatic initial load of data to a new table copy concurrently with active replication to existing table copies. The method and system should not require that replication be suspended at the source or any of the existing table copies during the load process. The present invention addresses such a need.